<?php

namespace app\admin\model\system;

use app\common\traits\ModelCurd;
use think\Model;

class Version extends Model
{
    protected $table = 'cp_version';
    protected $autoWriteTimestamp = true;
    use ModelCurd;

    public function getVersionCodeAttr($value,$data)
    {
        $info = [];
        switch ($value)
        {
            case 1:

                $info = [
                    "title"  => 'Alpha初步版',
                    "value"  => $value,
                    "v_code" => 'Alpha'
                ];
                break;
            case 2:

                $info = [
                    "title"  => 'Beta测试版',
                    "value"  => $value,
                    "v_code" => 'Beta'
                ];
                break;
            case 3:

                $info = [
                    "title"  => 'γ成熟版',
                    "value"  => $value,
                    "v_code" => 'γ'
                ];
                break;
            case 4:

                $info = [
                    "title"  => 'Trial试用版',
                    "value"  => $value,
                    "v_code" => 'Trial'
                ];
                break;
            case 5:

                $info = [
                    "title"  => 'Unregistered未注册版',
                    "value"  => $value,
                    "v_code" => 'Unregistered'
                ];
                break;
            case 6:

                $info = [
                    "title"  => 'Demo演示版',
                    "value"  => $value,
                    "v_code" => 'Demo'
                ];
                break;
            case 7:

                $info = [
                    "title"  => 'Release正式版',
                    "value"  => $value,
                    "v_code" => 'Release'
                ];
                break;
            case 8:

                $info = [
                    "title"  => 'Registered注册版',
                    "value"  => $value,
                    "v_code" => 'Registered'
                ];
                break;

        }
        return $info;
    }

}